﻿using System;


namespace PanGu
{
    public class Calculation
    {
        public static string ConvertTo36System(int decimalNumber)
        {
            if (decimalNumber > 0)
            {
                string result = "";
                int temp = 0;
                while (decimalNumber > 35)
                {
                    temp = decimalNumber % 36;
                    if (temp <= 9)
                        result += temp.ToString();
                    else
                        result += Convert.ToChar(temp - 10 + 'a');
                    decimalNumber = decimalNumber / 36;
                }
                if (decimalNumber <= 9)
                    result += decimalNumber.ToString();
                else
                    result += Convert.ToChar(decimalNumber - 10 + 'a');
                Char[] rs = result.ToCharArray();
                Array.Reverse(rs);
                return new string(rs);
            }
            else
            {
                return null;
            }
        }
    }
}
